<template>
  <div class="s-container">
    <div class="article_con" ref="article_con">
      <h3>{{ dataObj.title }}</h3>
      <p>{{ dataObj.date }}</p>
      <div class="tinymce-container" v-html="dataObj.content"></div>
    </div>
    <div v-show="Object.keys(dataObj).length > 0" class="btn_bottom" @click="back">
      返回
    </div>
  </div>
</template>

<script>
export default {
  props: {
    dataObj: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  methods: {
    back () {
      this.$emit('close')
    }
  },
  watch: {
    dataObj () {
      this.$refs.article_con.scrollTop = 0
    }
  }
}
</script>

<style lang="less" scoped>
  @import "./Index";
</style>
